﻿<UserControl x:Class="Songhay.BiggestBox.Desktop.Modules.AnalogDigit.Views.AnalogDigitView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    xmlns:rx="clr-namespace:Songhay.Desktop.Controls;assembly=Songhay.Desktop.Controls.AnalogDigit"
    xmlns:rxSharedModels="clr-namespace:Songhay.BiggestBox.Portable.Shared.Models;assembly=Songhay.BiggestBox.Portable.Shared"
    d:DesignWidth="{x:Static rxSharedModels:AppScalars.ModuleWidth}" d:DesignHeight="{x:Static rxSharedModels:AppScalars.ModuleHeight}">
    <UserControl.Resources>

        <Style TargetType="StackPanel">
            <Setter Property="HorizontalAlignment" Value="Center" />
        </Style>

        <Style x:Key="PlusMinusButton" TargetType="Button">
            <Setter Property="Cursor" Value="Hand" />
            <Setter Property="FontFamily" Value="Courier New" />
            <Setter Property="FontWeight" Value="Bold" />
            <Setter Property="Margin" Value="4" />
            <Setter Property="Width" Value="16" />
        </Style>
    </UserControl.Resources>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="10*" />
            <RowDefinition Height="90*" />
        </Grid.RowDefinitions>
        <TextBlock Grid.ColumnSpan="2" Style="{StaticResource H1Style}" Text="Analog, “Rolling” Digit Sample" />
        <StackPanel Grid.Column="0" Grid.Row="1">
            <rx:AnalogDigit
                Margin="8"
                HorizontalAlignment="Left" VerticalAlignment="Top"
                Fill="#FF875353"
                DigitValue="{Binding SingleDigitValue}"
                Width="150"
                />
            <StackPanel Orientation="Horizontal">
                <Button
                    Command="{Binding ChangeSingleDigitValueCommand}"
                    CommandParameter="-"
                    Content="-"
                    Style="{StaticResource PlusMinusButton}"
                    />
                <Button
                    Command="{Binding ChangeSingleDigitValueCommand}"
                    CommandParameter="+"
                    Content="+"
                    Style="{StaticResource PlusMinusButton}"
                    />
            </StackPanel>
        </StackPanel>
        <StackPanel Grid.Column="1" Grid.Row="1">
            <StackPanel Orientation="Horizontal">
                <rx:AnalogDigit
                    Margin="4"
                    HorizontalAlignment="Left" VerticalAlignment="Top"
                    DigitValue="{Binding MultipleDigitValueCollection[5]}"
                    Width="30"
                    />
                <rx:AnalogDigit
                    Margin="4"
                    HorizontalAlignment="Left" VerticalAlignment="Top"
                    DigitValue="{Binding MultipleDigitValueCollection[4]}"
                    Width="30"
                    />
                <rx:AnalogDigit
                    Margin="4"
                    HorizontalAlignment="Left" VerticalAlignment="Top"
                    DigitValue="{Binding MultipleDigitValueCollection[3]}"
                    Width="30"
                    />
                <rx:AnalogDigit
                    Margin="4"
                    HorizontalAlignment="Left" VerticalAlignment="Top"
                    DigitValue="{Binding MultipleDigitValueCollection[2]}"
                    Width="30"
                    />
                <rx:AnalogDigit
                    Margin="4"
                    HorizontalAlignment="Left" VerticalAlignment="Top"
                    DigitValue="{Binding MultipleDigitValueCollection[1]}"
                    Width="20"
                    />
                <rx:AnalogDigit
                    Margin="4"
                    HorizontalAlignment="Left" VerticalAlignment="Top"
                    DigitValue="{Binding MultipleDigitValueCollection[0]}"
                    Width="20"
                    />
            </StackPanel>
            <StackPanel Orientation="Horizontal">
                <TextBox x:Name="MultipleDigitText"
                    FontFamily="Courier New"
                    FontSize="16"
                    Text="{Binding MultipleDigitValue, Mode=OneWay}"
                    Width="128"
                    />
                <Button
                    Command="{Binding ChangeMultipleValueCommand}"
                    CommandParameter="{Binding Text, ElementName=MultipleDigitText}"
                    Content="Update"
                    />
            </StackPanel>
        </StackPanel>
    </Grid>
</UserControl>
